﻿using SalePerformance.Core.Configuration;
using SalePerformance.Core.Data.DBConfig;
using SalePerformance.Model.Model;
using System.Data.Entity;

namespace SalePerformance.Core.Data
{
    public class SalePerformanceEntities : DbContext
    {
        public SalePerformanceEntities() : base(SystemConfiguration.ConnectionString) { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            Database.SetInitializer<SalePerformanceEntities>(null);
            base.OnModelCreating(modelBuilder);
            modelBuilder.Configurations.Add(new TblSpDepositEopConfiguration());
            modelBuilder.Configurations.Add(new TblSpLoanEopConfiguration());
            modelBuilder.Configurations.Add(new HuntingCustomerConfiguration());
            modelBuilder.Configurations.Add(new TblSpCashManagementEopConfiguration());
            modelBuilder.Configurations.Add(new TblSpTradeEopConfiguration());
            modelBuilder.Configurations.Add(new SaleKpiConfiguration());
            modelBuilder.Configurations.Add(new KpiRankBranchConfiguration());
            modelBuilder.Configurations.Add(new KpiRawDnbqDailyConfiguration());
            modelBuilder.Configurations.Add(new BilAwardRankingDailyConfiguration());
            modelBuilder.Configurations.Add(new KpiRawCardDailyConfiguration());
            modelBuilder.Configurations.Add(new SaleContestBilAwardRawConfiguration());
            modelBuilder.Configurations.Add(new KpiRawKhhdDailyConfiguration());
            modelBuilder.Configurations.Add(new KpiMsboRawDailyConfiguration());
        }
        public DbSet<TblSpDepositEop> DepositEOP { get; set; }
        public DbSet<TblSpLoanEop> LoanEOP { get; set; }
        public DbSet<TblHuntingCustomer> HuntingCustomers { get; set; }
        public DbSet<TblSpCashManagementEop> CashManagementEops { get; set; }
        public DbSet<TblSpTradeEop> TradeEops { get; set; }
        public DbSet<TblSalePerformanceKpi> SaleKPIs { get; set; }
        public DbSet<TblKpiRankBranch> KpiRankBranchs { get; set; }
        public DbSet<TblKpiRawDnbqDaily> KpiRawDnbqDailys { get; set; }
        public DbSet<TblKpiRawCardDaily> KpiRawCardDailys { get; set; }
        public DbSet<TblKpiRawKhhdDaily> KpiRawKhhdDailys { get; set; }
        public DbSet<TblSaleContestBilawardRankingDaily> BilawardBranchRankingDailys { get; set; }
        public DbSet<TblSaleContestBilAwardRaw> SaleContestBilAwardRaws { get; set; }
        public DbSet<TblKpiMsboRaw> KpiMsboRawDailys { get; set; }
    }
}
